﻿using System;

namespace Needle.DevToolkit.Traits
{
    [Serializable]
    internal class ParentItem : Item, IParent
    {
        ItemCollection _Items;
        public ItemCollection Items
        {
            get
            {
                if (_Items == null)
                    _Items = new ItemCollection(this);
                return _Items;
            }
        }

        public override void Accept(IItemVisitor visitor)
        {
            base.Accept(visitor);
            Items.Accept(visitor);
        }
    }
}
